package daily.mar0320;

class Demo {
    public Demo() { }

    public Demo(int a, int b, int c) {
        int[] array = {a, b, c};
        int max = array[0], i;
        for (i = 1; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
        }
        System.out.println(max);
    }

    public Demo(float a, float b, float c) {
        float[] array = {a, b, c};
        float max = array[0];
        int i;
        for (i = 1; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
        }
        System.out.println(max);
    }

    static int getMax(int a, int b, int c) {
        int max = a > b ? (a > c ? a : c) : (b > c ? b : c);
        return max;
    }
}

public class MethodOverloadApply {
    public static void main(String[] args) {
        new Demo(123, 456, 456);
        new Demo(123.456F, 789.1011F, 456.789F);
        System.out.println(Demo.getMax(2,2,1));
    }
}
